package com.xuecheng.media.domain.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @Author: LiJunXi
 * @Description:
 * @Date: 2024-08-18  10:46
 */
@Data
public class UploadRecord {

    @TableId(type = IdType.AUTO)
    private Long id;

    @TableField("file_id")
    private String fileId;

    @TableField("create_time")
    private LocalDateTime createTime;

    private Integer status;

    public static UploadRecord getDefault(String fileMd5) {
        UploadRecord uploadRecord = new UploadRecord();
        uploadRecord.setFileId(fileMd5);
        uploadRecord.setCreateTime(LocalDateTime.now());
        return uploadRecord;
    }
}
